<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script>
for(var i=0;i<10;i++){
		document.write("<input type='checkbox' name='one' />&nbsp;&nbsp;&nbsp;")	
	};	
window.onload=function(){
	var links=document.getElementsByTagName('a');
	var one=document.getElementsByName('one');
	links[0].onclick=function(){
		for(var i=0;i<one.length;i++){
			one[i].checked=true;	
		};	
	};
	links[1].onclick=function(){
		for(var i=0;i<one.length;i++){
			one[i].checked=false;	
		};	
	};
	links[2].onclick=function(){
		for(var i=0;i<one.length;i++){
			if(one[i].checked==false){
				one[i].checked=true;		
			}else{
				one[i].checked=false;		
			};
		};		
	};
	
};
</script>
</head>

<body>
<a href="javascript:;">全选</a>
<a href="javascript:;">全不选</a>
<a href="javascript:;">反选</a>
</body>
</html>
